dojo.provide("xray.Grid");

dojo.require("dojox.grid.DataGrid");

dojo.declare("xray.Grid", dojox.grid.DataGrid, {
	postrender: function(){
		this.postresize();
		// for some reason AIR doesn't like this
		// this.focus.initFocusView();
		// make rows unselectable
		dojo.setSelectable(this.domNode, false);
	},
});

xray.Grid.markupFactory = function(props, node, ctor, cellFunc){
	return dojox.grid._Grid.markupFactory(props, node, ctor, function(node, cellDef){
		var field = dojo.trim(dojo.attr(node, "field")||"");
		if(field){
			cellDef.field = field;
		}
		cellDef.field = cellDef.field||cellDef.name;
		if(cellFunc){
			cellFunc(node, cellDef);
		}
	});
}
